﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace AccionesWindows
{
    public class LogWindows
    {

        public LogWindows(string mensaje)
        {

            EventLog eventLog1 = new EventLog();
            if (!System.Diagnostics.EventLog.SourceExists("MySource"))
            {
                System.Diagnostics.EventLog.CreateEventSource(
                    "MySource", "MyNewLog");
            }
            eventLog1.Source = "MySource";
            eventLog1.Log = "MyNewLog";

            eventLog1.WriteEntry(mensaje, EventLogEntryType.Information);
        }

    }
}
